#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
#include <time.h>
#include <string.h>
#include "Parameters.h"
#include "simulation.h"
#include "editor.h"
#include "evolution.h"






//prototypes
int (*mixRule(int (*p1)[16][8],int (*p2)[16][8]))[16][8];

int main ( int argc, char** argv )
{

    SDL_Surface *ecran = {NULL };
    SDL_Init(SDL_INIT_VIDEO);
    ecran = SDL_SetVideoMode(SIZE_WIDTH*100,SIZE_HEIGHT*100, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
    if (ecran == NULL)
    {
        fprintf(stderr, "Impossible de charger le mode vidéo : %s\n", SDL_GetError());
        exit(EXIT_FAILURE);
    }
    SDL_WM_SetCaption("braitenberg Machine", NULL);

    //core of the programme



    simulate(ecran);






    //Quitting
    SDL_FreeSurface(ecran);
    SDL_Quit();

    return EXIT_SUCCESS;

}
void pause()
{
    int continuer = 1;
    SDL_Event event;

    while (continuer)
    {
        SDL_WaitEvent(&event);
        switch(event.type)
        {
        case SDL_QUIT:
            continuer = 0;
        }
    }
}